# -*- coding: utf-8 -*-
__author__ = 'Zelgadiss Graywords'

from sqlalchemy import Table, Column, Integer, String, MetaData, ForeignKey

# Album binding

album_table = Table('Album', MetaData(),
                    Column('id', Integer, primary_key=True),
                    Column('name', String),
                    Column('year', String),
                    Column('label', String),
                    Column('country', String),
                    Column('genre', String),
                    Column('format', String),
                    Column('catalog_number', String),
                    Column('barcode', String),
                    Column('mastering_sid_code', String),
                    Column('mould_sid_code', String),
                    Column('matrix', String),
                    Column('other_code', String),
                    Column('artist', ForeignKey)
)

class Album(object):
    def __init__(self, name, genre, format, **kwargs):
        self.name = name
        self.genre = genre
        self.format = format
        if kwargs.get('year', False):
            self.year = kwargs['year']
        if kwargs.get('label', False):
            self.label = kwargs['label']
        if kwargs.get('country', False):
            self.country = kwargs['country']
        if kwargs.get('catalog_number', False):
            self.catalog_number = kwargs['catalog_number']
        if kwargs.get('barcode', False):
            self.barcode = kwargs['barcode']



